package design.SimpleFactory;

//工厂类，进行加工
public class CourseFactory {
    public Icourse create(Class clazz){
      /*  if("java".equals(name)){
            return new JavaCourse();
        }else{
            return null;
        }*/
      try {
          if (clazz != null) {
              return (Icourse) clazz.newInstance();
          }
      }catch (Exception e){
        e.printStackTrace();
        }
      return null;
    }
}
